﻿Imports System.Configuration
Imports System.Reflection

Public Class frmLauncher
    Public Shared posX As Integer
    Public Shared posY As Integer

    'Dim ensambladoAs As Assembly = Assembly.LoadFrom("imagenesDLL.dll")
    'Dim recursos As New Resources.ResourceManager("imagenesDLL.Resources", ensambladoAs)

    Dim frmMessageBox As New frmMessageBox
    Private Sub frmLauncher_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
        Try
            If e.KeyCode = Keys.Enter Then
                frmMessageBox.Text = "Ventana MessageBox"
                frmMessageBox.lblMessageBox.Text = "MessageBox Personalizado..."
                frmMessageBox.ShowDialog()
            End If
        Catch ex As Exception
            frmMessageBox.Text = "Error en frmLauncher_KeyDown"
            frmMessageBox.lblMessageBox.Text = ex.Message.ToString
            frmMessageBox.ShowDialog()
        End Try
    End Sub

    Private Sub frmLauncher_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        posX = Me.Location.X
        posY = Me.Location.Y
        '//Cargar iconos barra de notificaciones
        cargaIconosBarraNotificacion()
    End Sub

    Private Sub cargaIconosBarraNotificacion()
        Try
            'Dim cerrar As Image = CType(recursos.GetObject("cerrar"), Image)
            'btnCerrar.Image = cerrar
            'Dim minimizar As Image = CType(recursos.GetObject("minimizar"), Image)
            'btnMinimizar.Image = minimizar
            '//**********************************************************************
            'PictureBox1.Image 
        Catch ex As Exception
            frmMessageBox.Text = "Error en cargaIconosBarraNotificacion"
            frmMessageBox.lblMessageBox.Text = ex.Message.ToString
            frmMessageBox.ShowDialog()
        End Try
    End Sub


    Private Sub pboxMenu_Click(sender As Object, e As EventArgs) Handles pboxMenu.Click
        pboxMenu.BackColor = Color.DeepSkyBlue
        RemoveHandler pboxMenu.MouseLeave, AddressOf pboxMenu_MouseLeave
        Dim openfrmMenu As New frmMenu
        openfrmMenu.ShowDialog()
        pboxMenu.BackColor = Color.DodgerBlue
    End Sub

    Private Sub pboxMenu_MouseHover(sender As Object, e As EventArgs) Handles pboxMenu.MouseHover
        pboxMenu.BackColor = Color.DeepSkyBlue
    End Sub

    Private Sub pboxMenu_MouseLeave(sender As Object, e As EventArgs) Handles pboxMenu.MouseLeave
        pboxMenu.BackColor = Color.DodgerBlue
    End Sub

    Private Sub btnCerrar_Click(sender As Object, e As EventArgs) Handles btnCerrar.Click
        Me.Close()
    End Sub

    Private Sub btnMinimizar_Click(sender As Object, e As EventArgs) Handles btnMinimizar.Click
         If Me.WindowState = FormWindowState.Normal Then
            Me.WindowState = FormWindowState.Minimized
        End If
    End Sub
End Class
